package tech.wetech.admin3.sys.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.wetech.admin3.sys.repository.*;

@Service
public class AooCleanService {
  private final DIDRepository didRepository;
  private AooUserRepository aooUserRepository;
  private AooPersCertiDataRepository aooPersCertiDataRepository;
  private AooCompCertiDataRepository aooCompCertiDataRepository;
  private AooAnotherMeRepository aooAnotherMeRepository;
  private AooAnotherSomeoneRepository aooAnotherSomeoneRepository;
  private AooVirtualManRepository aooVirtualManRepository;

  public AooCleanService(
    AooUserRepository aooUserRepository,
    AooPersCertiDataRepository aooPersCertiDataRepository,
    AooCompCertiDataRepository aooCompCertiDataRepository,
    AooAnotherMeRepository aooAnotherMeRepository,
    AooAnotherSomeoneRepository aooAnotherSomeoneRepository,
    AooVirtualManRepository aooVirtualManRepository,
    DIDRepository didRepository
  ){
    this.aooUserRepository = aooUserRepository;
    this.aooPersCertiDataRepository = aooPersCertiDataRepository;
    this.aooCompCertiDataRepository = aooCompCertiDataRepository;
    this.aooAnotherMeRepository = aooAnotherMeRepository;
    this.aooAnotherSomeoneRepository = aooAnotherSomeoneRepository;
    this.aooVirtualManRepository = aooVirtualManRepository;
    this.didRepository = didRepository;
  }

  @Transactional
  public void deleteAooUser(){
    aooUserRepository.deleteAllInBatch();
  }

  @Transactional
  public void deleteAooPersCertiData(){
    aooPersCertiDataRepository.deleteAllInBatch();
  }

  @Transactional
  public void deleteAooCompCertiData(){
    aooCompCertiDataRepository.deleteAllInBatch();
  }

  @Transactional
  public void deleteAooAnotherMe(){
    aooAnotherMeRepository.deleteAllInBatch();
  }

  @Transactional
  public void deleteAooAnotherSomeone(){aooAnotherSomeoneRepository.deleteAllInBatch();}

  @Transactional
  public void deleteAooVirtualMan(){
    aooVirtualManRepository.deleteAllInBatch();
  }

  public void deleteDID() {
    didRepository.deleteAllInBatch();
  }
}
